<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<?php if (count($alternate)): ?>
	<?php foreach ($alternate as $i): ?>
		<link rel="alternate" type="<?php echo $i['type'] ?>" title="<?php _e($i['title']) ?>" href="<?php echo $i['url'] ?>" />
	<?php endforeach; ?>
<?php endif; ?>

<style type="text/css" media="screen">
<?php foreach ($stylesheets as $i): ?>
	@import url(<?php echo $ui['styles'] ?><?php echo $i ?>.css);
<?php endforeach; ?>
</style>

<title>
<?php if ($pagetitle && $pagetitle != $gene_name): 
	_e($pagetitle) ?> - <?php _e($gene_name); 
else: 
	_e($gene_name);
endif; ?>
</title>

<script type="text/javascript">
var geneurl = '<?php echo $gene_uri ?>';
var objecturl = '<?php echo Gene::makeLink("") ?>'
var ui = new Array();
<?php foreach ($ui as $i => $j): ?>
	ui['<?php _e($i) ?>'] = '<?php _e($j) ?>';
<?php endforeach; ?>
</script>

<?php foreach ($scripts as $i): ?>
	<script type="text/javascript" src="<?php echo $ui['scripts'] ?><?php echo $i ?><?php if (substr($i, strlen($i)-4) != '.php'): ?>.js<?php endif; ?>"></script>
<?php endforeach; ?>
</head>
<body class="geneone-ui-default">

<ul id="accesslinks">
<li><a href="#content" accesskey="2">Skip to main content</a></li>
<li><a href="<?php echo Gene::makeLink(Gene::metaID('Accessibility')) ?>#accesskeys" accesskey="0">Accesskey Information</a></li>
<li><a href="<?php echo Gene::makeLink(Gene::metaID('Terms')) ?>" accesskey="8">Terms of Service</a></li>
</ul>

<div id="memberbar">
<?php if ($loggedin): ?>
	 <strong><?php _e($member['name']) ?>:</strong>
	 <?php if (getUserProperty(Gene::tableName('object_drafts'))): ?>
	 	<strong><a href="<?php echo Gene::makeLink(Gene::specialId('Drafts')) ?>">Drafts (<?php echo getUserProperty(Gene::tableName('object_drafts')) ?>)</a></strong> | 
	 <?php endif; ?>
	 <a href="<?php echo Gene::makeLink(Gene::userId($member['name'])) ?>">Public Profile</a> | 
	 <a href="<?php echo Gene::makeLink(Gene::specialId('Settings')) ?>">Settings</a> | 
	 <a href="<?php echo Gene::makeLink(Gene::metaId('FAQ')) ?>">Help</a> | 
	 <?php if ($_SERVER['REQUEST_METHOD'] == 'GET'): ?>
	 	<a href="<?php echo addArguments(Gene::makeLink(Gene::specialId('Logout')), array('r' => $objectid)) ?>">Sign Out</a>
	 <?php else: ?>
	 	<a href="<?php echo Gene::makeLink(Gene::specialId('Logout')) ?>">Sign Out</a>
	 <?php endif; ?>
<?php else: ?>
	<strong>Not Signed In:</strong> 
	<?php if ($_SERVER['REQUEST_METHOD'] == 'GET'): ?>
	 	<a href="<?php echo addArguments(Gene::makeLink(Gene::specialId('Login')), array('r' => $objectid)) ?>">Sign In</a> | 
	 <?php else: ?>
	 	<a href="<?php echo Gene::makeLink(Gene::specialId('Login')) ?>">Sign In</a> | 
	 <?php endif; ?>
	<a href="<?php echo Gene::makeLink(Gene::specialId('Register')) ?>">Create an Account</a> | 
	<a href="<?php echo Gene::makeLink(Gene::metaId('FAQ')) ?>">Help</a>
<?php endif; ?>
</div>

<form action="<?php echo Gene::makeLink(Gene::specialId('Search')) ?>" method="get" id="search">
<input type="hidden" name="s" value="<?php echo Gene::specialId('Search') ?>" />
<?php if ($searchtype): ?>
	<input type="hidden" name="type" value="<?php _e($searchtype) ?>" />
<?php endif; ?>
<p><input type="text" id="searchfield" accesskey="s" name="q"<?php if ($searchterm): ?> value="<?php _e($searchterm) ?>"<?php endif; ?> /> <input type="submit" value="Search" /></p>
</form>

<h1><a href="<?php echo $gene_uri ?>" accesskey="1"><img src="<?php echo $ui['images'] ?>logo.png" alt="<?php _e($gene_name) ?>" /></a></h1>

<?php if ($actions): ?>
	<ul id="actionlinks">
	<?php foreach ($actions as $i): ?>
		<?php if ($i[2]): /* Current Action */?> 
			<li class="currentact"><?php _e($i[1]) ?></li>
		<?php else: ?>
			<li><a href="<?php echo $curlbase ?>/<?php echo $i[0] ?>"><?php _e($i[1]) ?></a></li>
		<?php endif; ?>
	<?php endforeach; ?>
	</ul>
<?php endif; ?>

<div id="sidebar">

<?php
foreach ($portlets as $i): 
	$this->display("portlets/".$i);
endforeach;

foreach ($textportlets as $i): 
	$this->display("portlets/generic", array("title" => $i[0], "content" => $i[1]));
endforeach;
?>

</div>

<div id="content">
<?php echo $finalbody ?>
</div>

<div id="footer">
<a href="<?php echo $application['homepage'] ?>" class="icon"><img src="<?php echo $ui['images'] ?>waves.png" alt="" /></a>
<p><a href="<?php echo $gene_uri ?>">Home</a> | <a href="<?php echo Gene::makeLink(Gene::metaId('Community_Portal')) ?>">Community Portal</a><br />
Copyright &copy; 2006 <?php _e($gene_name) ?>. <a href="<?php echo Gene::makeLink(Gene::metaId('Terms')) ?>">Terms of Service</a>.<br />
Powered by <a href="<?php echo $application['homepage'] ?>"><?php _e($application['name']) ?> <?php echo $application['version'] ?></a>.</p>
</div>

</body>
</html>